const events = {}

export function useMapEvent() {
  const setEvent = (key, event) => {
    events[key] = event
  }

  const getEvent = (key) => {
    return events[key]
  }

  const removeEvent = (key) => {
    delete events[key]
  }

  return { setEvent, getEvent, removeEvent }
}
